package com.sat.exception;

import com.baomidou.mybatisplus.extension.api.R;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * 统一返回异常
 */
@ControllerAdvice
@ResponseBody
public class RExceptionHandler {
    @ExceptionHandler(Exception.class)
    public R handler(Exception e) {
        return R.failed(e.getMessage());
    }
}
